package com.itheima.health.controller;

import com.itheima.health.entity.Result;
import com.itheima.health.service.SetmealService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/setmeal")
public class SetmealController {
    @Autowired
    private SetmealService setmealService;

    //查询所有套餐展示出来
    @GetMapping("/getAllSetmeal.do")
    public Result getAllSetmeal(){
        Result result = setmealService.getAllSetmeal();
       return result;
    }

    //回显套餐详情
    @PostMapping("/findById.do")
    public Result findById(Integer id){
        Result result = setmealService.findById(id);
        return result;

    }
}
